package com.nchu.web.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

public class QuizInterceptor implements Interceptor{

	@Override
	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		String problem =controller.getAttr("problem_content");
		String teacherId = controller.getSessionAttr("teacherId");
		String appointId = controller.getSessionAttr("appointStu");
		if((teacherId==null)||(teacherId=="")){
			System.out.println(" Not accessing");
		}else{
			controller.setSessionAttr("_problem_content", problem);
			controller.setSessionAttr("_appointStu", appointId);
			controller.setSessionAttr("_teacherId", teacherId);
			inv.invoke();
			
		}
		
		
	}

}
